package com.online.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.online.entity.JudgeQuestion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface JudgeQuestionMapper {

    /**
     * 增加判断题
     * @param judgeQuestion
     * @return
     */

    int add(JudgeQuestion judgeQuestion);

    /**
     * 查询最后一条记录的questionId
     * @return
     */
    JudgeQuestion findOnlyQuestionId();

    List<JudgeQuestion> findByIdAndType(Integer paperId);

    List<Integer> findBySubject(String subject, Integer judgeNumber);

    @Select("select * from judge_question")
    IPage<JudgeQuestion> findAll(Page page);
}
